js date add 1 day

53

js date add 1 day -

let date = new Date();
// add a day
date.setDate(date.getDate() + 1);

javascript add day to date -

function addDays(date, days) {
  var result = new Date(date);
  result.setDate(result.getDate() + days);
  return result;
}

Javscript Add days on Date -

function addDays(date, days) {
  const copy = new Date(Number(date))
  copy.setDate(date.getDate() + days)
  return copy
}

const date = new Date();
const newDate = addDays(date, 10);

add 1 day to date js -

var date = new Date();

// add a day
date.setDate(date.getDate() + 1);

Comments

Submit
0 Comments